home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / rfvdemo / vx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-14  |  1.0 KB  |  45 lines

  1. // VX_C
  2.  
  3. // A class implementing a virtual 320x240x16/160x240x256 screen in mode x.
  4.  
  5. #include "def.h"
  6.  
  7. // DEFINES:
  8.  
  9. #define VRAMSIZE         19200
  10.  
  11. // VGA-registers:
  12.  
  13. #define AC_INDEX        0x03c0
  14. #define MISC_OUTPUT     0x03c2
  15. #define SC_INDEX        0x03c4
  16. #define GC_INDEX    0x03ce
  17. #define CRTC_INDEX      0x03d4
  18. #define INPUT_STATUS_0  0x03da
  19. #define MAP_MASK    0x02
  20. #define READ_MAP        0x04
  21. #define BIT_MASK    0x08
  22.  
  23. // MACROS:
  24.  
  25. #define FROMLATCHES     asm mov dx,GC_INDEX; asm mov ax,BIT_MASK;asm out dx,ax
  26. #define FROMREGISTER     asm mov dx,GC_INDEX+1;asm mov al,0xff;asm out dx,al
  27.  
  28. // CLASS DECLARATION:
  29.  
  30. class vx_C
  31. {
  32.   word offset;
  33. public:
  34.   vx_C();
  35.   ~vx_C();
  36.  
  37.   void setoffset(word newoffset);
  38.   void frame(void);
  39.   void writepixel(word pos, byte plane, byte color);
  40.   void putpixel(word x,word y,byte color)
  41.     {writepixel(offset+x/4+80*y,x&3,color);};
  42.   byte getpixel(word x,word y);
  43.   void setrgb(byte color, byte r, byte g, byte b);
  44.   void blockfill(word start,word end, byte data);
  45. };